{include file="pub/header" /}
<style>
#icon_img{height:32px;}
</style>
</head>
<body>

<div class="subnav">
    <div class="content_menu ib_a blue line_x">
        <a href="javascript:;"><span class="pagetitle">【菜单管理】</span></a>
        <?php if($info){ ?>
        <span>|</span>
        <a href="{:url('edit')}" class="on"><em>添加菜单</em></a>
        <?php } ?>
        <span>|</span>
        <a href="{:url('index')}?pid={$info['pid']}"><em>返回列表</em></a>
    </div>
</div>

<div class="pad_lr_10" >
	<form action="" method="post" id="myform">
	<input type="hidden" name="id" value="{$info['id']}">
	<input type="hidden" name="pid" value="{$pid}">
    <table width="100%" cellspacing="0" class="table_form">
        <tbody>
			<tr>
				<th width="100" class="rt">所属节点：</th>
				<td>
				  <select name="pid"  class="J_cate_select mr10">
				  <option value="0">根目录</option>
				   <?php echo $menu; ?>
				  </select>
				</td>
			</tr>
			<tr>
				<th><font color="red">*</font> 菜单名称：</th>
				<td>
					<input name="title" type="text" value="{$info['title']}" class="input-text" size="50">
				</td>
			</tr>
			<tr>
				<th>对应路径：</th>
				<td>
					<input name="path" type="text" value="{$info['path']}"  class="input-text" size="50">
					<span class="gray ml10">目录结构 无需链接（1、2级），页面和操作需要（3、4级）</span>
				</td>
			</tr>
			<tr>
				<th>菜单显示：</th>
				<td>
					<label><input name="is_show" type="radio" value="1" <?php echo (empty($info)||1==$info['is_show'])?'checked':'';?>>显示</label>&nbsp;&nbsp;
					<label><input name="is_show" type="radio" value="0" <?php echo (0===$info['is_show'])?'checked':'';?>>隐藏</label>
					<span class="gray ml10">在菜单位置是否显示</span>
				</td>
			</tr>
			<tr>
				<th>权限显示：</th>
				<td>
					<label><input name="manage_show" type="radio" value="1" <?php echo (empty($info)||1==$info['manage_show'])?'checked':'';?>>显示</label>&nbsp;&nbsp;
					<label><input name="manage_show" type="radio" value="0" <?php echo (0===$info['manage_show'])?'checked':'';?>>隐藏</label>
					<span class="gray ml10">在权限组设置位置是否显示</span>
				</td>
			</tr>
			<tr>
				<th>图标：</th>
				<td>
					<input name="icon" type="hidden" value="{$info['icon']}" id="icon">
					<?php if($info['icon']){ ?>
						<img src="{$info['icon']}" id="icon_img" style="cursor:hand">
						<?php }else{ ?>
						<img height="32" src="/static/admin/img/upload-pic.png" id="icon_img" style="cursor:hand">
					<?php } ?>
					<input type="button" id="choose_icon" value="选择图标" class="btn" onclick="get_icon(set_icon,'icon','icon_img',1);">
					<a href="javascript:;" onclick="removeIcon('icon');">移除</a>
				</td>
			</tr>
			<tr>
				<th width="120">&nbsp;</th>
                <td valign="bottom">
					<input class="smt mr10" type="button" name="submit" onclick="ajaxpost('myform');" value="<?php echo $info?'修改':'添加';?>" />
				</td>
			</tr>
        </tbody>
    </table>
    </form>
</div>
<script>
function removeIcon(textareaid){
	$('#' + textareaid + '_img').attr('src', '/static/admin/img/upload-pic.png');
	$('#' + textareaid).val('');
}
</script>

{include file="pub:footer" /}
